﻿// =================================================================== 
// 数据实体层(GDIT.Model)实体映射
//====================================================================
// 文件：Mtb_VideoInformationArticle.cs
// 项目名称：学院网站
// 创建时间：2012-08-08
// 负责人：ChenZhiGang
// 引用DevExpress.Xpo程序集
// 程序集介绍：视频资讯实体类
// ===================================================================
using DevExpress.Xpo;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace GDIT.Model
{
    public class Mtb_VideoInformationArticle : PersistentClass
    {
        public Mtb_VideoInformationArticle()
            : base()
        {
            this.Modified = false;
        }

        public Mtb_VideoInformationArticle(Session theSession)
            : base(theSession)
        {
            this.Modified = false;
        }

        private string _videoName = string.Empty;
        /// <summary>
        /// 视频资讯名称
        /// </summary>
        [DbType("varchar(50)")]
        public string VideoName
        {
            get { return _videoName; }
            set
            {
                if (_videoName != value)
                {
                    _videoName = value;
                    if (!IsLoading) { this.Modified = true; }
                }
            }
        }

        private string _linkAddress = string.Empty;
        /// <summary>
        /// 视频资讯链接地址
        /// </summary>
        [DbType("varchar(256)")]
        public string LinkAddress
        {
            get { return _linkAddress; }
            set
            {
                if (_linkAddress != value)
                {
                    _linkAddress = value;
                    if (!IsLoading) { this.Modified = true; }
                }
            }
        }

        private DateTime _publishDate = DateTime.Now;
        /// <summary>
        /// 视频资讯发布时间
        /// </summary>
        [DbType("datetime")]
        public DateTime PublishDate
        {
            get { return _publishDate; }
            set
            {
                if (_publishDate != value)
                {
                    _publishDate = value;
                    if (!IsLoading) { this.Modified = true; }
                }
            }
        }

        private string _visible = "否";
        /// <summary>
        /// 公告是否内部显示
        /// </summary>
        [DbType("varchar(2)")]
        public string IsVisible
        {
            get { return _visible; }
            set
            {
                if (_visible != value)
                {
                    _visible = value;
                    if (!IsLoading) { this.Modified = true; }
                }
            }
        }

        private string _top = "否";
        /// <summary>
        /// 公告是否置顶
        /// </summary>
        [DbType("varchar(2)")]
        public string Top
        {
            get { return _top; }
            set
            {
                if (_top != value)
                {
                    _top = value;
                    if (!IsLoading) { this.Modified = true; }
                }
            }
        }

        private string _important = "否";
        /// <summary>
        /// 视频资讯是否重点
        /// </summary>
        [DbType("varchar(2)")]
        public string Important
        {
            get { return _important; }
            set
            {
                if (_important != value)
                {
                    _important = value;
                    if (!IsLoading) { this.Modified = true; }
                }
            }
        }

        /// <summary>
        /// 防止编辑后马上保存
        /// </summary>
        protected override void EndEdit()
        {
            return;
        }

        /// <summary>
        /// 检验数据
        /// </summary>
        /// <returns></returns>
        public override string GetDataError()
        {
            if (this._linkAddress.Trim().Length == 0) { return string.Format("视频资讯链接地址不能为空"); }
            if (this._videoName.Trim().Length == 0) { return string.Format("视频资讯名称不能为空"); }
            return "";
        }
    }
}
